/**
 * Created by Jackie.Chen on 2017/5/17.
 */
'use strict'
var testTemplete = require('html!./situation.html');
require('./situation.less');
module.exports ={
  template: testTemplete,
  data:function(){
    return{
      interModelList:[],
      commonModelList:[],
      name:localStorage.getItem("name"),
      lastLoginTime:localStorage.getItem("lastLoginTime"),
      userId:localStorage.getItem("userId")
    }
  },
  created: function() {
    this.getInterModel();
    this.getCommonModel();
  },
  methods:{
    getInterModel:function(){
      var me = this;
      this.$http.get('/user/getIntrestInduModel.do')
        .then(function(res) {
          //加动态id
          if(res.data.status === 'OK'){
            if(res.data.result){
              me.interModelList = res.data.result;
            }
            console.log( me.interModelList);
          }else{
            layer.msg('系统繁忙，请稍后再试');
          }
        }.bind(this));
    },
    getCommonModel:function(){
      var me = this;
      this.$http.get('/user/getCommonModel.do')
        .then(function(res) {
          //加动态id
          if(res.data.status === 'OK'){
            if(res.data.result){
              console.log(res.data.result);
              me.commonModelList = res.data.result;
            }
          }else{
            layer.msg('系统繁忙，请稍后再试');
          }
        }.bind(this));
    },
    gotoDetail:function(id){
      this.$router.replace('/product/modelDe/:id');
    }
  }
};

